﻿namespace UFIDA.U9.Hello.ConfigBP
{
	using System;
	using System.Collections.Generic;
	using System.Text;
    using UFIDA.U9.CBO.QC.QCSchema;
    using UFSoft.UBF.AopFrame;	
	using UFSoft.UBF.Util.Context;

	/// <summary>
	/// GetQCSchema partial 
	/// </summary>	
	public partial class GetQCSchema 
	{	
		internal BaseStrategy Select()
		{
			return new GetQCSchemaImpementStrategy();	
		}		
	}
	
	#region  implement strategy	
	/// <summary>
	/// Impement Implement
	/// 
	/// </summary>	
	internal partial class GetQCSchemaImpementStrategy : BaseStrategy
	{
		public GetQCSchemaImpementStrategy() { }

		public override object Do(object obj)
		{						
			GetQCSchema bpObj = (GetQCSchema)obj;
			List<QCSchemaDTO> retlist = new List<QCSchemaDTO>();

			if (bpObj.QCGuideLineID == null)
				throw new Exception("传入参数为空");
            QCSchema.EntityList entityList = QCSchema.Finder.FindAll("1=1", null);
			if(entityList != null)
            {
				foreach(var entity in entityList)
                {
					QCSchemaDTO retdto=new QCSchemaDTO();
					retdto.ID = entity.ID.ToString();
					retdto.Code = entity.Code;
					retdto.Name = entity.QCSchemaHead.Name;
					retdto.Version = entity.Version;
					retlist.Add(retdto);
				}
            }

            return retlist;
		}		
	}

	#endregion
	
	
}